package org.luxor.eshop.order.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.luxor.commons.core.validator.group.UpdateGroup;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;


/**
 * 订单与商品项的关联关系
 *
 * @author administrator @date 2020-12-04 15:47:45
 */
@Data
@TableName("tb_order_commodity")
@ApiModel(description = "订单与商品项的关联关系")
public class OrderCommodityEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@TableId(type = IdType.ASSIGN_ID)
	@ApiModelProperty(value = "主键Id")
	@JSONField(serializeUsing = ToStringSerializer.class)
	@NotNull(message = "id，不能为空", groups = UpdateGroup.class)
	private Long id;

	@ApiModelProperty(value = "归属订单ID")
	@JSONField(serializeUsing = ToStringSerializer.class)
	@NotNull(message = "orderId，不能为空")
	private Long orderId;

	@ApiModelProperty(value = "商品编号")
	private String commodityCode;

	@ApiModelProperty(value = "购买数量")
	private Integer quantity;

	@ApiModelProperty(value = "商品名称")
	private String commodityName;

	@ApiModelProperty(value = "商品单价")
	private BigDecimal commodityPrice;

}
